<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>5.9.流程控制-循环结构-do...while循环-练习1</title>
    <script>
        //1.人的一生 从1岁到100岁
        var i = 1;
        do {
            console.log('这人' + i + '岁了');
            i++;
        } while (i <= 100)
        console.log('----------------------------------');

        //2.计算1~100之间所有整数的和
        var sum = 0;
        var j = 1;
        do {
            sum += j;
            j++
        } while (j <= 100)
        console.log(sum);
        console.log('----------------------------------');

        //3.弹出提示框 输入你爱我吗? 如果输入我爱你，就提示结束，否则， 一直询问
        do {
            var message = prompt('你爱我吗?');
        } while (message !== '爱')
        alert('我也爱你')
    </script>
</head>

<body>

</body>

</html>